import Vue from 'vue'
import VueRouter from 'vue-router'
//首页
import Index from "@/views/jww/index.vue"
//潮In美发
import Fashion from "@/views/jww/fashion.vue"
//卡项
import Cards from "@/views/jww/cards.vue"
//提交卡项订单
import submitGoodsVue from '@/views/jww/submitGoods.vue'
//待支付
import PaymentVue from '@/views/jww/payment.vue'
//商品详情页
import DetailsNew from '@/views/jww/detailsNew.vue'
// 登录
import Login from '../views/wby/login.vue'
// 注册
import Register from '../views/wby/register.vue'

//预约
import Reservation from '@/views/reservation/home.vue'
//新增预约
import Appointment from '@/views/reservation/appointment.vue'
//确认预约
import Confirmap from '@/views/reservation/confirmap.vue'
//预约记录
import Record from '@/views/reservation/record.vue'


// 产品首页
import Pro from '../views/wby/proindex.vue'
// 提交
import Submit from '../views/wby/submitorder.vue'
// 留言
import Message from '../views/wby/message.vue'


// 会员卡
import MessageSJ from '../views/sj/vip/messageSJ.vue'
import Myfrom from '../views/sj/vip/myfrom.vue'
import Orders from '../views/sj/vip/orders.vue'
import Log from '../views/sj/vip/log.vue'
import ReservationSJ from '../views/sj/vip/reservationSJ.vue'
import Shops from '../views/sj/vip/shops.vue'
import Equity from '../views/sj/vip/equity.vue'
import Entry from '../views/sj/vip/entry.vue'
import J from '@/views/sj/j.vue'
import Payments from '../views/sj/vip/payments.vue'
import Records from '../views/sj/vip/records.vue'


const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
},
Vue.use(VueRouter)

const routes = [
       {
         path: '/',
         redirect:'/login',
         name: 'login',
       },
       {
        path:'/index',
        name:"index",
        component:Index,
        title:'美发店',
        meta:{
          title:"首页"
        },
       },
       {
        path:"/fashion",
        name:"fashion",
        component:Fashion,
        title:"项目详情",
        meta:{
          title:"项目详情",
        }
      },
      {
        path:"/detailsNew",
        name:"detailsNew",
        component:DetailsNew,
        title:"产品详情",
        meta:{
          title:"产品详情",
        }
      },
      {
        path:"/cards",
        name:"cards",
        component:Cards,
        title:"卡项详情",
        meta:{
          title:"卡项详情",
        }
      },
      {
        path:"/submitGoods",
        name:"submitGoods",
        component:submitGoodsVue,
        title:"提交订单",
        meta:{
          title:"提交订单",
        }
      },
      {
        path:"/payment",
        name:"payment",
        component:PaymentVue,
        title:"待支付",
        meta:{
          title:"待支付",
        }
      },
      {
          path: '/reservation',
          name: 'Reservation',
          component: Reservation
         },
         //新增预约
         {
          path: '/appointment',
          name: 'Appointment',
          component: Appointment
         },
         //确认预约
         {
          path: '/confirmap',
          name: 'Confirmap',
          component: Confirmap
         },
         //预约记录
         {
          path: '/record',
          name: 'Record',
          component: Record
         },
          // 产品
         {
          path: '/pro',
          name: 'Pro', 
          component: Pro ,
          },
          // 登录
          {
            path: '/login',
            component: Login,
          },
          // 提交
          {
            path: '/submit',
            component:Submit,
          },
          // 注册
          {
            path: '/register',
            component:Register,
          },
          // 留言
          {
            path: '/message',
            component:Message,
          },
          // 会员卡
          {
            path:'/j',
            component:J
          },
          // 会员卡页
          {
            path: '/orders',
            name: 'orders',
            component: Orders
          },
          {
            path: '/log',
            name: 'log',
            component: Log,
          },
          {
            path: '/messageSJ',
            name: 'messageSJ',
            component: MessageSJ,
          },
          {
            path: '/myfrom',
            name: 'myfrom',
            component: Myfrom,
          },
          {
            path: '/reservationSJ',
            name: 'reservationSJ',
            component: ReservationSJ,
          },
          {
            path: '/shops',
            name: 'shops',
            component: Shops,
          }, 
           {
            path: '/equity',
            name: 'equity',
            component: Equity,
          },
          {
            path: '/entry',
            name: 'entry',
            component: Entry,
          },
          {
            path:'/payments',
            component:Payments
          },
          {
            path: '/records',
            name: 'Records',
            component: Records
           }
]

const router = new VueRouter({
  routes
})

export default router
